#include<stdio.h>
#include"process.h"
#include<stdlib.h>
#include<time.h>


const int base=10;
double total=2048.0;
double once=0.1;

void download()
{
	double current=0.0;
	while(current<total)
	{
		//模拟下载行为
		int r=rand()%base+1;
		double speed=r*once;
		current+=speed;
		if(current>=total) current=total;
		usleep(100000);


		//更新除了本次新的下载量
		Process(total,current);
	}
	printf("\n");
}

int main()
{
	srand(time(NULL));
	download();
	return 0;
}
